/*
 * Copyright 2007-2008  Lukasz Laszko lukaszlaszko@gmail.com
 * 
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purpose and without fee is hereby
 * granted, provided that the above copyright notice appear in all
 * copies and that both that the copyright notice and this
 * permission notice and warranty disclaimer appear in supporting
 * documentation, and that the name of the author not be used in
 * advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 * 
 * The author disclaim all warranties with regard to this
 * software, including all implied warranties of merchantability
 * and fitness.  In no event shall the author be liable for any
 * special, indirect or consequential damages or any damages
 * whatsoever resulting from loss of use, data or profits, whether
 * in an action of contract, negligence or other tortious action,
 * arising out of or in connection with the use or performance of
 * this software. 
 */
package org.pg.biomedics.asr.mpeg7;

import java.util.List;
import java.util.ArrayList;

import org.simpleframework.xml.Root;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Attribute;

/**
 * The series of lattice nodes within the block.
 * @author Lukasz Laszko
 */
@Root(name="Node")
public class Node 
{
    // <editor-fold desc="Fields">
    
    /** the number of this node in the current block. */
    private int num;
    
    /** the time offset of this node, measured in one-hundredths of a second, measured from the beginning of the current block. */
    private int timeOffset;
    
    /** an optional reference to the SpeakerInfo corresponding to this node. */
    private String speakerInfoRef;
    
    /** a series of WordLink descriptions (see the section below) all the  links starting from this node and carrying a word hypothesis */
    private List<WordLink> wordLinks = new ArrayList<WordLink>();
    
    /** a series of PhoneLink descriptions (see the section below) all the links starting from this node and carrying a phone hypothesis. */
    private List<PhoneLink> phoneLinks = new ArrayList<PhoneLink>();    
           
    // </editor-fold>
    
    // <editor-fold desc="Properties">
    
    @Attribute(name="num")
    public int getNum()
    {
        return num;
    }

    @Attribute(name="num")
    public void setNum(int num)
    {
        this.num = num;
    }

    @Attribute(name="timeOffset")
    public int getTimeOffset()
    {
        return timeOffset;
    }

    @Attribute(name="timeOffset")
    public void setTimeOffset(int timeOffset)
    {
        this.timeOffset = timeOffset;
    }

    @Attribute(name="speakerInfoRef", required=false)
    public String getSpeakerInfoRef()
    {
        return speakerInfoRef;
    }

    @Attribute(name="speakerInfoRef", required=false)
    public void setSpeakerInfoRef(String speakerInfoRef)
    {
        this.speakerInfoRef = speakerInfoRef;
    }

    @ElementList(inline=true, required=false)
    public List<WordLink> getWordLinks()
    {
        return wordLinks;
    }
    
    @ElementList(inline=true, required=false)
    void setWordLinks(List<WordLink> wordLinks)
    {
        this.wordLinks = wordLinks;
    }

    @ElementList(inline=true, required=false)
    public List<PhoneLink> getPhoneLinks()
    {
        return phoneLinks;
    }
    
    @ElementList(inline=true, required=false)
    void setPhoneLinks(List<PhoneLink> phoneLinks)
    {
        this.phoneLinks = phoneLinks;
    }
    
    // </editor-fold>
}
